//
//  XXTGHomeWebObject.m
//  XiuXiuTuanGou
//
//  Created by 王克博 on 2019/1/7.
//  Copyright © 2019 XiuXiuTuanGou. All rights reserved.
//

#import "XXTGHomeWebObject.h"

@implementation XXTGHomeWebObject

- (void)shareWithTitle:(NSString *)title Description:(NSString *)description Image:(NSString *)image URL:(NSString *)url
{
    NSLog(@"收到方法");
    NSMutableDictionary * dict = [NSMutableDictionary dictionary];
    [dict setObject:title forKey:@"title"];
    [dict setObject:description forKey:@"description"];
    [dict setObject:image forKey:@"image"];
    [dict setObject:url forKey:@"url"];
    [[NSNotificationCenter defaultCenter] postNotificationName:kJSUseAppMethod_Share object:nil userInfo:dict];
}

- (void)saveImage:(NSString *)image
{
    [[NSNotificationCenter defaultCenter] postNotificationName:kJSUseAppMethod_SaveImage object:nil userInfo:@{@"imageBase64String":image}];
}

- (void)appStatisticsWithEventId:(NSString *)eventId QuestionId:(NSString *)questionId
{
    if (questionId && questionId.length > 0) {
        [[NSNotificationCenter defaultCenter] postNotificationName:kJSUseAppMethod_Statistics object:nil userInfo:@{@"eventId":eventId, @"questionId":questionId}];
    }else {
        [[NSNotificationCenter defaultCenter] postNotificationName:kJSUseAppMethod_Statistics object:nil userInfo:@{@"eventId":eventId}];
    }
}

@end
